/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c) 2002, GeoVISTA Center
 * Licensed under Simplified BSD License
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 *
 *
 * @original author: jin Chen 
 * @author: jin Chen 
 * @date: Nov 10, 2008$
 * @version: 1.0
 */
package edu.psu.geovista.app.vit.pub.views;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import javax.swing.*;
import java.awt.*;

@XStreamAlias("View")
public class BasicView implements View {
    private String ID;// 
    private String name; //human readable name

    private Rectangle bound;//bound of the frame which contain the view component

    @XStreamAlias("viewtype")
    private String viewType;//data variable name 
    protected transient VitPubViewMgr viewMgr;
    private transient boolean save=true;


    public BasicView() {
        bound =new Rectangle(100,100,800,600);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public Rectangle getBound() {
        return bound;
    }

    public void setBound(Rectangle bound) {
        this.bound = bound;
    }

  


    public VitPubViewMgr getViewMgr() {
        return viewMgr;
    }

    public void setViewMgr(VitPubViewMgr viewMgr) {
        this.viewMgr = viewMgr;
    }



    public JComponent getViewComponent() {
        return viewMgr.getViewComponent(this.getID() );
    }


    public String getViewType() {
        return viewType;
    }

    public void setViewType(String viewType) {
        this.viewType = viewType;
    }
    public boolean isSave() {
        return save;
    }

    public void setSave(boolean save) {
        this.save = save;
    }
}
